using System.Collections.Generic;
using System.IO;
using ActivateYourGlutes.Model.Contracts;

namespace ActivateYourGlutes.Model.Providers
{
    public interface IBodyProvider : IProviderBase
    {
        /// <summary>
        /// Returns a list of the measurement types that can be logged against
        /// </summary>
        List<MeasurementType> MeasurementTypes { get; }
        /// <summary>
        /// Returns a list of measurement types that are selected by default (for example when viewing graphs)
        /// </summary>
        List<MeasurementType> DefaultMeasurementTypes { get; }
        /// <summary>
        /// Returns a series of values for a users selected primary measurement type
        /// </summary>
        Series PrimaryIndicatorSeries(Account user);
        /// <summary>
        /// Returns a series of values for a users selected secondar measurement type
        /// </summary>
        Series SecondaryIndicatorSeries(Account user);
        /// <summary>
        /// Returns a series of measurement values for the specified measurementt type
        /// </summary>
        Series SeriesForIndicator(Account user, MeasurementType type, bool padding);
        /// <summary>
        /// Returns a paged view of logged body measurements for a given user
        /// </summary>
        IEnumerable<Body> BodiesForAccount(Account user, int offset, int pageSize);
        /// <summary>
        /// Adds a body measurement set to the database
        /// </summary>
        void Add(Body body);
        /// <summary>
        /// Updates a body measurement set in the database
        /// </summary>
        void Update(Account updatingUser, Body body);
        /// <summary>
        /// Deletes a body measurement set from the database
        /// </summary>
        void Delete(Account deletedBy, int bodyId);
        /// <summary>
        /// Returns a body measurement set based on an id
        /// </summary>
        Body GetBodyById(Account requestingAccount, int id);
        /// <summary>
        /// Gets the latest measurements by combining the latest measurement of each type for the account
        /// </summary>
        Body ConsolidatedBody(Account user);
        /// <summary>
        /// Returns all body measurement sets for a given account
        /// </summary>
        IEnumerable<Body> All(Account forAccount);
        /// <summary>
        /// Writes all body measurement sets as XML to the supplied stream
        /// </summary>
        void ToXml(Account forAccount, Stream stream);
        /// <summary>
        /// Returns the total number of body measurement sets in the account
        /// </summary>
        int TotalBodiesForAccount(Account forAccount);
    }
}